package com.panasonic.web.controller.cms;

import com.panasonic.common.core.controller.BaseController;
import com.panasonic.common.core.domain.AjaxResult;
import com.panasonic.web.domain.cms.CmsConfig;
import com.panasonic.web.service.ICmsConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 配置Controller
 *
 * @author lwf
 * @date 2021-11-12
 */
@RestController
@RequestMapping("/cms/config")
@Api(value = "CmsConfig", tags = "配置")
public class CmsConfigController extends BaseController {
    @Autowired
    private ICmsConfigService cmsConfigService;

    /**
     * 查询配置列表
     */
    @ApiOperation(value = "查询")
    @GetMapping
    public AjaxResult get() {
        CmsConfig config = cmsConfigService.selectCmsConfig();
        return AjaxResult.success(config);
    }

    @ApiOperation(value = "保存")
    @PostMapping("/save")
    public AjaxResult save(@RequestBody CmsConfig config) {
        cmsConfigService.save(config);
        return AjaxResult.success();
    }


}
